{% include "public/header.html" %}
<div class="content">
    {% include "user/menu.html" %}

    <div class="fr huiyuan_main">
        <div class="hy_table" style="margin-top:0">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="hy_tb_tt">
                <tr>
                    <td class="bg_f8" width="">商品详情</td>
                    <td class="bg_f8" width="120">实付款(元)</td>
                    <td class="bg_f8" width="120">交易操作</td>
                    <td class="bg_f8" width="120" style="border-right:0;">订单详情</td>
                </tr>
            </table>

            {% for v in data %}

            <div class="hy_table_order c666">
                <span class="fl">订单编号：{{v.id}}</span>
                <span class="fr">下单时间：{{v.atime|date('Y-m-d H:i')}}</span>
                <div class="clear"></div>
            </div>
            <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #D4E7FF;">
                <tr>
                    <td style="text-align:left;">
                        {% for kk,vv in v.orderdata %}
                        <div class="dingdan_list" style="padding-top:0">
                            <a href="/product/{{vv.pid}}" class="fl mar5"><img src="{{res}}/product/{{vv.plogo}}" width="45" height="45"></a>
                            <div class="fl font12">
                                <a href="/product/{{vv.pid}}" title="{{vv.pname}}" target="_blank" class="cblue dd_name">{{vv.pname}}</a>
                            </div>
                            <span class="fr font12"><span class="num"><small>￥</small>{{vv.pmoney}}</span>(×{{vv.pnum}})</span>
                            <div class="clear"></div>
                        </div>
                        {% endfor %}
                    </td>
                    <td width="100">

                        <p class="cred num font14 strong">{{v.money}}</p>

                        <p class="c888 font12">{% if v.wlmoney == 0 %} (卖家包邮) {% else %} (含运费{{v.wlmoney}}元) {% endif %}</p>
                    </td>
                    <td width="100">
                        {# 货到付款 #}
                        {% if v.payway == 3 %}
                        {% if v.state == 1 %}
                        <p class="cgreen font13">订单创建成功</p>
                        <p class="cred font13">等待卖家发货</p>
                        {% elseif v.state == 3 %}
                        <p class="cgreen font13">卖家已经发货</p>
                        <p class="cred font13">等待买家付款</p>
                        {% elseif v.state == 4 %}
                        <p class="cgreen font13">交易成功</p>
                        {% endif %}
                        {# 先款后货 #}
                        {% elseif v.payway == 2%}
                        {% if v.state == 1 %}
                        <p class="cgreen font13">订单创建成功</p>
                        <p class="cred font13">等待买家付款</p>
                        {% elseif v.state == 2%}
                        <p class="cgreen font13">买家付款成功</p>
                        <p class="cred font13">等待卖家发货</p>
                        {% elseif v.state == 3%}
                        <p class="cgreen font13">卖家已经发货</p>
                        <p class="cred font13">确认收货</p>
                        {% elseif v.state == 4%}
                        <p class="cgreen font13">交易成功</p>
                        {% endif %}
                        {% elseif v.payway == 1%}

                        {% endif %}
                    </td>
                    <td width="100">
                        <a href="/user/orderview/{{v.id}}" target="_blank" class="font13">订单详情</a>
                        {% if v.state == 1 %}
                        <p class="mat3">
                            <a href="/user/orderdel/{{v.id}}"  onclick="return confirm('确定要删除订单吗？')"  class="cblue font12">删除订单</a>
                        </p>
                        {% endif %}
                    </td>
                </tr>
            </table>
            {% endfor %}

            <div class="hy_pay"  style="text-align: center;padding:10px 0px">

                <style>
                    ul.pagination {
                        display: inline-block;

                    }
                    .pagination li {
                        padding:0 10px;
                        float:left;
                        text-align: center;
                        margin:0 5px;
                        background:#cccccc;
                    }
                    .pagination .active {
                        background:#FF922a;

                    }
                </style>
                {% autoescape false %}
                {{fpage}}
                {% endautoescape %}

            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>


{% include "public/footer.html" %}